import { lazy } from 'react'
import { createBrowserRouter } from 'react-router-dom'
import {
    AppOutline,
    MessageOutline,
    MessageFill,
    UnorderedListOutline,
    UserOutline,
} from 'antd-mobile-icons'
const Login = lazy(() => import('../pages/login/index'))
const Home = lazy(() => import('../pages/home/index'))
const User = lazy(() => import('../pages/user/index'))
const Layout = lazy(() => import('../pages/layout/index'))
const Order = lazy(() => import('../pages/order/index'))
const Socket = lazy(() => import('../pages/socket/index'))
export const childrenRouter = [
    { path: '/layout/home', element: <Home />, title: '首页', icon: <AppOutline /> },
    { path: '/layout/user', element: <User />, title: '待办', icon: <UnorderedListOutline />, },
    { path: '/layout/order', element: <Order />, title: '消息', icon: <MessageOutline /> },
    { path: '/layout/socket', element: <Socket />, title: '我的', icon: <UserOutline />, },
]
const routes = createBrowserRouter([
    { path: '/login', element: <Login /> },
    { path: '/404', element: <div>404</div> },
    { path: '/layout', element: <Layout />, children: childrenRouter }
])

export default routes